<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:composite="http://java.sun.com/jsf/composite"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:p="http://primefaces.prime.com.tr/ui">

<!-- INTERFACE -->
<composite:interface>
	<composite:attribute name="doctorController" />
	<composite:attribute name="editMode" />
</composite:interface>

<!-- IMPLEMENTATION -->
<composite:implementation>
	<div id="#{cc.clientId}">
		<h:panelGrid columns="9" id="addDoctorContent">
			<h:outputText value="#{translatorService.translate('addDoctor.name')}:" />
			<h:inputText id="name" value="#{cc.attrs.doctorController.name}"
				size="20" required="true" label="Name"
				onkeypress="return allowedChars(event,'0123456789.,')" />

			<h:message for="name" style="color:red" />

			<h:outputText value="#{translatorService.translate('addDoctor.surname')}:" />
			<h:inputText id="surname"
				value="#{cc.attrs.doctorController.surname}" size="20"
				required="true" label="Surname"
				onkeypress="return allowedChars(event,'0123456789.,')" />

			<h:message for="surname" style="color:red" />
			
			<h:outputText value="#{translatorService.translate('addDoctor.surname')}:" />
			<h:selectOneMenu id="status" styleClass="fieldSelection" value="#{cc.attrs.doctorController.active}">
				<f:selectItems
					value="#{outOfWorkController.getDiscreteValueProvider().getDiscreteValueSet('DoctorStatus')}" />
			</h:selectOneMenu>
			
			<h:message for="status" style="color:red" />
			
		</h:panelGrid>
		<p:spacer width="100%" height="10" />
		<h:panelGrid columns="2" id="addDoctorButton">
			<p:commandButton value="#{translatorService.translate('addDoctor.button.add')}"
				actionListener="#{doctorController.addDoctor}" 
				update="@form"/>
			<p:commandButton value="#{translatorService.translate('addDoctor.button.add')}"
				actionListener="#{doctorController.updateDoctor}" 
				update="@form"/>
		</h:panelGrid>
	</div>
</composite:implementation>
</html>
